package com.wbw.csnd_hd.service.Impl;

import com.wbw.csnd_hd.common.ResultCommon;
import com.wbw.csnd_hd.mapper.GroupMapper;
import com.wbw.csnd_hd.service.GroupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

@Service
public class GroupServiceImpl implements GroupService {

    @Autowired
    GroupMapper groupMapper;

    @Override
    public Map<String,Integer> statisticsGroup(String no) {
        //先去查询当前组的库位总数
        int LocationTotal = groupMapper.statisticsLocationTotal(no);
        //查询当前组剩余库位数
        int RemainingTotal = groupMapper.RemainingLocationTotal(no);
        //待出库的物品数
        int waitTotal = groupMapper.waitTotal(no);
        HashMap<String, Integer> map = new HashMap<>();
        map.put("LocationTotal",LocationTotal);
        map.put("RemainingTotal",RemainingTotal);
        map.put("waitTotal",waitTotal);

        return map;
    }
}
